package chat;

import java.io.Serializable;

/**
 * The Message class represents a message that can be put in the chat window.
 * 
 * @author Lois Fozzard
 * 
 */
public abstract class Message implements Serializable
{
    private static final long serialVersionUID = 1L;
    private String messageString;

    /**
     * Constructs the Message object. All extending classes must call this
     * constructor.
     * 
     * @param message
     *            the plain text String this Message is to contain (i.e. no html
     *            tags)
     */
    public Message(String message)
    {
        messageString = message;
    }

    /**
     * abstract. returns the message with proper html tags added.
     * 
     * @return a String containing the message and html tags.
     */
    public abstract String getHTML();

    /**
     * returns the plain text String this Message contains (i.e. no html tags)
     * 
     * @return the plain text String this Message contains.
     */
    public final String getPlainText()
    {
        return messageString;
    }

}
